#ifndef __MYSCREEN_H__
#define __MYSCREEN_H__

#include <Windows.h>
class CScreen
{
public:	
	int _limLeft,_limRight,_limBottom;
	RECT Camera;
	CScreen(int leftCamera,int limLeft,int limRight,int limBottom)
	{		
		_limLeft=limLeft;
		_limRight=limRight;
		_limBottom=limBottom;

		Camera.left=leftCamera;
		Camera.top=0;
		Camera.right=Camera.left+WINDOW_WIDTH;
		Camera.bottom=WINDOW_HEIGHT;
	}
	void Reset()
	{
		Camera.left=0;
		Camera.top=0;
		Camera.right=Camera.left+WINDOW_WIDTH;
		Camera.bottom=WINDOW_HEIGHT;
	}
	void MoveCamera(int detaX)
	{
		if(Camera.left<0)
		{
			Camera.left=0;
			Camera.right=WINDOW_WIDTH;
			return;
		}
		else if(Camera.right>_limRight)
		{
			Camera.right=_limRight;
			Camera.left=_limRight-WINDOW_WIDTH;
			return;
		}
		
		Camera.left+=detaX;
		Camera.right+=detaX;
	}
};
#endif